package com.starinside.wp.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * *******************************
 * Created by Tim.
 * form com.matt
 * on 2017/7/18
 * *******************************
 */
@Entity
@Data
@EqualsAndHashCode(callSuper=true)
@Table(name = "userchildren")
public class RelUserChildren extends Model {

    @Column(name = "uid")
    private String userId;

    @Column(name = "cid")
    private String childrenId;

    @Column(name = "relation")
    private String relation;

    @Column(name = "createTime")
    private Date created = new Date();

    @Column(columnDefinition = "longtext COMMENT '备注'")
    private String remark;

    @Column(columnDefinition = " bit DEFAULT 1 COMMENT '摄像头权限开关' ")
    private Boolean cameraEnabled = true;

    @Column(columnDefinition = " bit DEFAULT 1 COMMENT '微信启用开关' ")
    private Boolean wechatEnabled = true;

    @Column(columnDefinition = " bit DEFAULT 1 COMMENT '模板消息开关' ")
    private Boolean templateMsgEnabled = true;

    @Column(columnDefinition = " bit DEFAULT 1 COMMENT '与老师聊天开关' ")
    private Boolean teacherChatEnabled = true;

    public static RelUserChildren of(String userId, String childrenId, String relation,String remark){
        RelUserChildren relUserChildren = new RelUserChildren();
        relUserChildren.setUserId(userId);
        relUserChildren.setChildrenId(childrenId);
        relUserChildren.setRelation(relation);
        relUserChildren.setRemark(remark);
        return relUserChildren;
    }
}
